<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	TravlogHashMap hm = RequestManager.getRequest(request);
	Member currentMem = null;
	if(hm.get("MEMBER")!=null)
		currentMem = (Member)hm.get("MEMBER");
	String currentSub = "";
	if(hm.get(TravlogVars.ATTR_USER_SUB)!=null)
		currentSub = hm.get(TravlogVars.ATTR_USER_SUB).toString();
	if(currentSub.length()==0)currentSub=TravlogVars.PARAMS_USER_SUB_MYLIST;
		
%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="comm.util.TravlogHashMap"%>
<%@page import="comm.util.RequestManager"%>
<%@page import="statics.TravlogVars"%>
<%@page import="com.ssu.judea.travlog.vo.Member"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.ssu.judea.travlog.vo.DatePost"%><html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="http://<%=request.getServerName()%><%=request.getContextPath()%>/js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="http://<%=request.getServerName()%><%=request.getContextPath()%>/js/jquery-ui-1.8rc2.custom.min.js"></script>
		
		<script type="text/javascript" src="http://<%=request.getServerName()%><%=request.getContextPath()%>/js/sexy-alert/jquery.easing.1.3.js"></script>
		<script type="text/javascript" src="http://<%=request.getServerName()%><%=request.getContextPath()%>/js/sexy-alert/sexyalertbox.v1.2.jquery.js"></script>
		<link rel="stylesheet" type="text/css" media="all" href="http://<%=request.getServerName()%><%=request.getContextPath()%>/js/sexy-alert/sexyalertbox.css"/>
		<script type="text/javascript" src="http://<%=request.getServerName()%><%=request.getContextPath()%>/js/fancybox/jquery.mousewheel-3.0.2.pack.js"></script>
		<script type="text/javascript" src="http://<%=request.getServerName()%><%=request.getContextPath()%>/js/fancybox/jquery.fancybox-1.3.1.js"></script>
		<link rel="stylesheet" type="text/css" href="http://<%=request.getServerName()%><%=request.getContextPath()%>/js/fancybox/jquery.fancybox-1.3.1.css" media="screen" />
		<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
		<script type="text/javascript" src="http://<%=request.getServerName()%><%=request.getContextPath()%>/js/travlog.js"></script>
		<link rel="stylesheet" type="text/css" href="http://<%=request.getServerName()%><%=request.getContextPath()%>/css/jquery-ui-1.8rc2.custom.css">
		<link rel="stylesheet" type="text/css" href="http://<%=request.getServerName()%><%=request.getContextPath()%>/css/default.css">
		
		<title>Travlog :: Share your lifelog!</title>
		<script type="text/javascript">
		<%if(request.getAttribute("dispatchAction")!=null){%>
			<%if(request.getAttribute("dispatchAction").toString().equals("afterLogout")){%>
				$(document).ready(function(){
				    alarm('로그아웃 되었습니다.');
				})
			<%}%>
		<%}%>
		</script>
	</head>
	<body>
		<div id="wrap">
			
			<jsp:include page="commons/header.jsp"></jsp:include>
			
			<div id="content">
				<div id="userHomeNavigator" class="floatLeft">
				
				<%if(hm.get(TravlogVars.ATTR_USER_ID)!=null){ %>
					<%if(currentMem==null){ %>
						<div><span class="invalidUserId"><%=hm.get(TravlogVars.ATTR_USER_ID) %></span> is not TravlogUser.</div>
						<div><input type="button" value="turn back" onclick="javascript:history.go(-2);"/></div>
					<%}else{ %>
						<div>
							<div>
								<a href="http://<%=request.getServerName()%><%=request.getContextPath()%><%=TravlogVars.SERVLET_PATH_USER%>/<%=hm.get(TravlogVars.ATTR_USER_ID)%>">
								@<%=currentMem.getTwitterid() %>
								<img src="<%=currentMem.getProfileurl() %>" title="<%=currentMem.getTwitterid() %>"/>
								</a>
							</div>
							
						</div>
						
						
						<div>
							<ul>
								<li>
									<a href="http://<%=request.getServerName()%><%=request.getContextPath()%><%=TravlogVars.SERVLET_PATH_USER%>/<%=hm.get(TravlogVars.ATTR_USER_ID)%>/<%=TravlogVars.PARAMS_USER_SUB_MYLIST%>">
										My List
									</a>
								</li>
								<!--
								<li>
									<a href="http://<%=request.getServerName()%><%=request.getContextPath()%><%=TravlogVars.SERVLET_PATH_USER%>/<%=hm.get(TravlogVars.ATTR_USER_ID)%>/<%=TravlogVars.PARAMS_USER_SUB_CALENDAR%>">
										Calendar
									</a>
								</li>
								-->
								<li>
									<a href="http://<%=request.getServerName()%><%=request.getContextPath()%><%=TravlogVars.SERVLET_PATH_USER%>/<%=hm.get(TravlogVars.ATTR_USER_ID)%>/<%=TravlogVars.PARAMS_USER_SUB_FOLLOWERS%>">
										Followers
									</a>
								</li>
							</ul>
						</div>
					<%} %>
				
				<%}else if(session.getAttribute("SESSION_MEMBER_SEQ")!=null){ %>
					<div class="myTravlogNavigatorHeader">
						My Travlog
					</div>
					<div>
						<ul>
							<li>
								<a href="http://<%=request.getServerName()%><%=request.getContextPath()%><%=TravlogVars.SERVLET_PATH_USER%>/<%=session.getAttribute("SESSION_MEMBER_TWITTER_ID").toString() %>/<%=TravlogVars.PARAMS_USER_SUB_MYLIST%>">
									My List
								</a>
							</li>
							<!-- 
							<li>
								<a href="http://<%=request.getServerName()%><%=request.getContextPath()%><%=TravlogVars.SERVLET_PATH_USER%>/<%=session.getAttribute("SESSION_MEMBER_TWITTER_ID").toString() %>/<%=TravlogVars.PARAMS_USER_SUB_CALENDAR%>">
									Calendar
								</a>
							</li>
							 -->
							<li>
								<a href="http://<%=request.getServerName()%><%=request.getContextPath()%><%=TravlogVars.SERVLET_PATH_USER%>/<%=session.getAttribute("SESSION_MEMBER_TWITTER_ID").toString() %>/<%=TravlogVars.PARAMS_USER_SUB_FOLLOWERS%>">
									Followers
								</a>
							</li>
						</ul>
					</div>
				<%} %>
				<!-- 
				<jsp:include page="commons/datePicker.jsp"></jsp:include>
				 -->
				</div>
				<div id="userHomeContent" class="floatLeft">
					<%if(currentMem!=null){ %>
						<div class="userHomeContentHeader">
							<span><%=currentMem.getTwitterid() %>'s <%=currentSub.toUpperCase()%></span>
						</div>
						<div class="userHomeContentBody">
						<%if(currentSub.equals(TravlogVars.PARAMS_USER_SUB_CALENDAR)){ %>
							calendar
						<%}else if(currentSub.equals(TravlogVars.PARAMS_USER_SUB_FOLLOWERS)){%>
							<%if(hm.get("LIST")!=null){
								ArrayList<DatePost> list = (ArrayList<DatePost>)hm.get("LIST"); 
							%>
								<%if(list==null || list.size()==0){ %>
									<div>
										<span class="regdate">Your followers not record posts</span>
									</div>
								<%} %>
								<%for(DatePost curPost : list){%>
									<div>
										<div class="button" onclick="getDatePost('http://<%=request.getServerName()%><%=request.getContextPath()%>','<%=curPost.getRegdate() %>','<%=curPost.getMemberseq()%>');">
											<span>@<%=curPost.getTwitterid() %><img src="<%=curPost.getImageurl() %>" title="<%=curPost.getTwitterid() %>"/>
											</span>
											<span class="regdate"><%=curPost.getRegdate() %>
											</span>
											<span class="postcount">
											<%=curPost.getPostscount() %>
											</span>
											Posts
										</div>
									</div>
								<%} %>
							<%} %>
						<%}else if(currentSub.equals(TravlogVars.PARAMS_USER_SUB_MYLIST)){%>
							<%if(hm.get("LIST")!=null){
								ArrayList<DatePost> list = (ArrayList<DatePost>)hm.get("LIST"); 
							%>
								<%if(list==null || list.size()==0){ %>
									<div>
										<span class="regdate">Never records posts</span>
									</div>
								<%} %>
								<%for(DatePost curPost : list){%>
									<div>
										<div class="button" onclick="getDatePost('http://<%=request.getServerName()%><%=request.getContextPath()%>','<%=curPost.getRegdate() %>','<%=curPost.getMemberseq()%>');">
											<span class="regdate"><%=curPost.getRegdate() %>
											</span>
											<span class="postcount">
											<%=curPost.getPostscount() %>
											</span>
											Posts
										</div>
									</div>
								<%} %>
							<%} %>
						<%}%>
						</div>						
					<%}%>
				</div>
				<div class="clear"></div>
			</div>
			<jsp:include page="commons/footer.jsp"></jsp:include>
			
		</div>
	</body>
</html>
